package com.company.common;

import java.util.HashMap;
import java.util.Map;

public class R {
    //成功
    private int code=200;

    private String message="操作成功";

    private Map<String,Object> data=new HashMap<>();

    public R add(String key,Object value){
        this.data.put(key,value);
        //链式调用
        return this;
    }

    public int getCode() {
        return code;
    }

    public R setCode(int code) {
        this.code = code;
        return this;
    }

    public String getMessage() {
        return message;
    }

    public R setMessage(String message) {
        this.message = message;
        return this;
    }

    public Map<String, Object> getData() {
        return data;
    }

    public void setData(Map<String, Object> data) {
        this.data = data;
    }
}
